<?php
class Gb_View_Helper_Logined extends Zend_View_Helper_Abstract {
	private $output;

	public function Logined() {
		$auth = Zend_Auth::getInstance();
		
		$this->output = '<div class="logined">';
		
		if($auth->hasIdentity()) {
			$user = $auth->getIdentity();
			$this->output .= 'Вы вошли как <a href="/user/profile/' . $user->login . '" title="">' . $user->login . '</a>';
		} else {
			$this->output .= '<a href="/user/login" title="">Войдите</a> либо <a href="/user/registration" title="">Зарегистрируйтесь</a>';
		}

		$this->output .= '</div>';
		
		return $this->output;
	}
}
?>
